<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/FoodSageTemplate.xhtml">

    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{touristLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>

    <ui:define name="main_menu">
        <f:view beforePhase="#{itineraryChooseItineraryTypeManagedBean.initView}"/>
        <p:menubar model="#{itineraryChooseItineraryTypeManagedBean.touristMainMenuModel}"/>
    </ui:define>

    <ui:define name="nav_menu">
        <p:menu model="#{itineraryChooseItineraryTypeManagedBean.touristNavMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <f:view beforePhase="#{purchaseGrouponManagerBean.initOfferedGrouponList}"></f:view>
        <h:form prependId="false">
            <br/>
            <br/>
            <p:fieldset style="text-align:center; width:1030px">               
                <h2>CURRENTLY OFFERED GROUPONS </h2>
                <br/>
                <p:dataGrid var="groupon" value="#{purchaseGrouponManagerBean.currentlyOfferedGrouponList}" columns="2"
                            rows="12" paginator="true" effect="true"
                            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                            rowsPerPageTemplate="6,8,10">
                    <p:column>
                        <p:fieldset style="text-align:center; width:470px">
                            <h:panelGrid columns="1">
                                <h:outputText value="#{groupon.groupon.name}" style="font-weight:bold; font-size:12px" />
                                <p:graphicImage value="/images/upload/media/#{groupon.groupon.imageURL}" height="300" width="450"/> 
                                <p:commandLink title="See more" action="tourist/VisitorViewGroupon?faces-redirect=true">
                                    <p:graphicImage value="/images/buttons/tout_button_see_more.jpg"/> 
                                    <f:setPropertyActionListener value="#{groupon}" 
                                                                 target="#{purchaseGrouponManagerBean.selectedGroupon}" />
                                </p:commandLink>
                            </h:panelGrid>
                        </p:fieldset>
                    </p:column>

                </p:dataGrid>
            </p:fieldset>

        </h:form>
    </ui:define>
</ui:composition>